feat(mf): layer-aware sharing and runtime scope-array support#12977
Draft
ScriptedAlchemy wants to merge 82 commits intomainfrom
Draft
feat(mf): layer-aware sharing and runtime scope-array support#12977ScriptedAlchemy wants to merge 82 commits intomainfrom
ScriptedAlchemy wants to merge 82 commits intomainfrom
Conversation
Contributor
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
Contributor
📦 Binary Size-limit
❌ Size increased by 40.75KB from 49.04MB to 49.08MB (⬆️0.08%) |
Merging this PR will not alter performance
Comparing Footnotes
|
2 tasks
test: retry native watcher watch steps Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Deploying rspack with
|
| Latest commit: |
492d8a4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0a3b86f4.rspack-v2.pages.dev |
| Branch Preview URL: | https://feat-mf-layers.rspack-v2.pages.dev |
Preserve string versus array share scope semantics while restoring the enhanced consume and remote runtime wiring needed for layer-aware federation. Fold the unrelated watch helper change back to main so this worktree stays focused on the MF runtime fix. Made-with: Cursor
Keep this MF layer/share-scope branch focused on the enhanced runtime fix by removing the stale module graph stats guard, which is not required for build:cli:dev or the container-1-5 serial cases. Made-with: Cursor
Keep the manifest path aligned with the original stats-driven parsing flow by deriving consumed shared package data from module identifiers instead of downcasting consume shared modules. Made-with: Cursor
Capture expose layer information in emitted MF stats and manifest output, and add a manifest-layers regression case to verify layered shared and expose metadata stays correct. Made-with: Cursor
Hydrate consume handler mappings from consumes loading data so bundler-runtime keeps layer-aware share metadata in the enhanced path. Also validate multi-entry share scopes unless enhanced mode is enabled, and emit remote external metadata alongside remote runtime records.
Keep provide shared runtime entries in their original shareScope shape and mark enhanced initializeSharingData as already updated so bundler-runtime does not rebuild downgraded shared registrations from the legacy structure.
Emit consume-shared source data for shared consumers and let the runtime module reuse it when serializing consume metadata. This keeps module-output consume entries callable so layered federation consumers can initialize sharing before resolving shared react. Made-with: Cursor
Made-with: Cursor
Wait for consume share scopes to finish initializing before delegating to the bundler runtime so layered shared modules resolve consistently. Remove the temporary federation debug instrumentation that was added while tracing the runtime flow. Made-with: Cursor
Drop the temporary discovery document now that the parity investigation is captured elsewhere. Made-with: Cursor
Reinstate legacy share-scope validation and restore the enhanced runtime metadata paths needed for layered consume and module remote resolution. Made-with: Cursor
Preserve layer-aware shared metadata across manifest generation, used-exports optimization, and module remote runtime wiring so layered federation outputs stay correct and covered. Made-with: Cursor
Keep layered consume scope initialization in the enhanced runtime while preserving legacy consume version-check behavior and rust lint parity. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What This Changes
layer/issuerLayermetadata through shared module configuration and runtime registrationcontainer-1-5layer serial cases and the matching sharing/tree-shaking casesWhy This PR Exists
Rspack already supports share scopes as arrays from earlier work. This PR is not re-adding generic array share-scope support.
The purpose of this PR is to add layer-aware federation behavior so layered shared modules and layered exposed modules work the same way as they do in Module Federation core.
Stack
Current stack, bottom to top:
feat(mf): layer-aware sharing and runtime scope-array support<- this PRfeat(mf): emit RSC metadata in federation manifestsfeat(rsbuild): add RSC federation host/remote examplefeat(rsbuild): add RSC federation module patternsfeat(rsc): register federation manifest data at runtime